<?php
/**
 * Created by PhpStorm.
 * User: qinkai
 * Date: 2019/5/13
 * Time: 9:22
 * Email: qinkai@ucex.pro
 */

namespace app\traits;



use think\facade\Cache;

trait Help
{
    public function checkCaptcha($code)
    {
        $captcha = new \think\captcha\Captcha();
        return $captcha->check($code);
    }

    //验证邮箱验证码
    public function checkEmailCode($email, $email_code)
    {
        $code = Cache::pull($email);
        if (!$code || $code != $email_code) {
            return false;
        }
        return true;
    }





}